<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript">
	$(function(){
		$("#more").click(function(){
		    var $a = $('<a href="#">取消</a>');
		    $a.click(function(){
		    	$(this).parent().remove();
		    });
			var $s = $('<div><input type="file" name="mf"></div>');
			$s.append($a);
			$("#fs").after($s);
		});
	});
	//移动option元素
	$(function(){
	   //添加＞＞按钮的处理
		$("#addBtn").click(function(){
			$("#s1 option:selected").appendTo("#s2");
		});
		//＜＜移除按钮的处理
		$("#deleteBtn").click(function(){
			$("#s2 option:selected").appendTo("#s1");
		});
	});
</script>
</head>
<body>
<h1>文档处理函数示例-2</h1>
<a href="#" id="more">上传更多</a>
<div id="fs">
	<input type="file" name="mf">
	<input type="button" name="btn" value="上传">
</div>
<hr/>
<select id="s1" multiple size="5">
	<option value="beijing">北京</option>
	<option value="shanghai">上海</option>
	<option value="guangzhou">广州</option>
</select>
<input type="button" value="添加＞＞" id="addBtn">
<input type="button" value="＜＜移除" id="deleteBtn">
<select id="s2" multiple  size="5"></select>
</body>
</html>